<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>每日签到</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="applicable-device" content="mobile">
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes, width=device-width">
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="css/style.css">
	<script src="js/jquery.js"></script>
    <script src="js/common.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){ 
    	$.ajax({
	        type: "POST",
	        url: "/personalcenter/getsignmonth",
	        dataType: "json",
	        success: function(data){
	        	if (data.result=="6") {
	        		window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxe643cc1b34aa8f25&redirect_uri=http%3a%2f%2fa6.189young.com%2fpersonalcenter%2fcheckuser&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
				}else{
					if(data.result=="1"){
		       			$("#stateday").html(0);
		       		}else{
		       			$("#stateday").html(data.state);
		       			$("#pointstoday").html(data.todaypoints);
		       			$("#pointstoday2").html(data.todaypoints);
		       			$("#totalpoints").html(data.statepoints);
		       			$.each(data.setday,function(){
		       				signdayup(this);
		       			}) 
		       			if(data.today==0){
		       				if(data.six==1){
		       					boxIn($('#sign6day'));
		       				}else{
		       					boxIn($('#regularsign'));
		       				}
		       			}
		       		}
				}
	        }	
		});
 	});
    
    function signdayup(day){
		// 给已签到日期添加圈
	    $(".calendar-day:eq("+(day-1)+")").addClass("on");
	}
    </script>
</head>
<body>
    <div class="page">

        <header class="base-header">
          <a href="javascript:history.go(-1);" class="btn-back posa">返回</a>
        </header>

        <div class="calendar-counter tc">连续签到<b id="stateday"></b>天</div>

        <div class="top-btns">
          <div class="top-btns-wrap tc">
            <div class="top-btn dib"><a href="point_rule.html">积分规则</a></div>
            <div class="top-btn dib"><a href="point_goods.html">积分兑换</a></div>
            <div class="top-btn dib"><a href="point_events.html">积分活动</a></div>
          </div>
        </div>

        <div class="calendar-month tc"><span class="calendar-y"></span>年<span class="calendar-m"></span>月</div>

        <div class="calendar">
          <div class="calendar-body clearfix">
          
          </div>
        </div>

     <!--   <a href="javascript:;" class="btn btn-orange btn-block btn-share">邀请好友补签</a>

        <ul class="friends-list">
          <li class="dib">
            <div class="img-box"><img src="img/bg.jpg" alt=""></div>
            <h6 class="tov">昵称难吃难吃难吃难吃呢</h6>
            <p>2018-02-03</p>
          </li>
          <li class="dib">
            <div class="img-box"><img src="img/bg.jpg" alt=""></div>
            <h6 class="tov">昵称难吃难吃难吃难吃呢</h6>
            <p>2018-02-03</p>
          </li>
          <li class="dib">
            <div class="img-box"><img src="img/bg.jpg" alt=""></div>
            <h6 class="tov">昵称难吃难吃难吃难吃呢</h6>
            <p>2018-02-03</p>
          </li>
          <li class="dib">
            <div class="img-box"><img src="img/bg.jpg" alt=""></div>
            <h6 class="tov">昵称难吃难吃难吃难吃呢</h6>
            <p>2018-02-03</p>
          </li>

        </ul> -->



        <div class="out-mask"></div>
        <!-- 签到成功弹窗 -->
        <div class="out-box out-index-success" id="regularsign">
          <div class="out-box-inner">
            <div class="out-close"></div>
            <h2 class="yellow-title tc">恭喜!签到成功!</h2>
            <p class="out-box-msg tc">获得<b id="pointstoday"></b>积分</p>
            <!-- <p class="out-box-msg tc">累计签到获得<b id=totalpoints></b>积分</p> -->
          </div>
        </div>

		 <!-- 签到成功弹窗 -->
        <div class="out-box out-index-success" id="sign6day">
          <div class="out-box-inner">
            <div class="out-close"></div>
            <h2 class="yellow-title tc">恭喜!签到成功!</h2>
            <p class="out-box-msg tc">获得<b id="pointstoday2"></b>积分</p>
            <p class="out-box-msg tc">连续6天签到额外获得<b>100</b>积分</p>
          </div>
        </div>
        
        <!-- 补签成功弹窗 -->
        <div class="out-box out-index-bu">
          <div class="out-box-inner">
            <div class="out-close"></div>
            <h2 class="tc">补签成功!</h2>
            <p class="out-box-msg tc">获得<b></b>积分</p>
          </div>
        </div>

        <!-- 邀请补签分享提示层 -->
        <div class="share-out">
          <div class="share-young"></div>
          <div class="share-out-txt tc">召集新朋友签到啦!</div>
          <div class="share-arrow"></div>
        </div>


    </div>

    <script>
    $(function(){

      // 日历计算天数
      var nDate=new Date,
          nYear=nDate.getFullYear(),
          nMonth=nDate.getMonth()+1,
          nDay=0;

      $('.calendar-y').text(nYear);
      $('.calendar-m').text(nMonth);

      if (nMonth != 2) {
        switch (nMonth) {
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
        nDay = 31;
        break;
        case 4:
        case 6:
        case 9:
        case 11:
        nDay = 30;
        }
      } else {
        // 闰年
        if (nYear % 4 == 0 && nYear % 100 != 0 || nYear % 400 == 0)
        nDay = 29;
        else
        nDay = 28;
      }

      for(var i=0;i<nDay;i++){
        $('.calendar-body').append('<div class="fl calendar-day">'+(i+1)+'</div>');
      }


        $(".btn-share").on('click',function(){
          $(".share-out").css({
            'pointer-events':'auto',
            'opacity':'1'
          });
        })
        $('.share-out').on('touchend',function(){
          $(this).css({
              'pointer-events':'none',
              'opacity':'0'
            });
        })


    })
    </script>

    <!--百度数据统计-->
    <script>var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src="https://hm.baidu.com/hm.js24866553cf6bdd25afcd437091f96447";var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s);})();</script>

</body>
</html>
















